{% extends "master.html" %}
{% block subtitle %} - 采购管理{% endblock %}


{% block main %}
<div class="container">
    <div class="row">
        <ol class="breadcrumb">
          <li><a href="{{url_for('bpRoot.view')}}">主面板</a></li>
          <li class="active">采购管理</li>
        </ol>
    </div>

    <div class="row">
        <div class="panel panel-primary">
            <div class="panel-heading"><h4 class="panel-title">输入查询条件</h4></div>
            <div class="panel-body">
                <div class="row">{{mymacros.render_search_form(form,3)}}</div>
                <div class="row">
                    <div class="col-md-12">
                        <div class="btn-toolbar pull-right">
                            <div class="btn-group"><button type="button" class="btn btn-default" onclick="$('form').submit()">{{BTN_SEARCH}}</button></div>
                            {% if getAllPermission(['PURCHASE_CREATE',]) %}
                                <div class="btn-group"><a href="{{url_for('bpPrh.view',action='add')}}" class="btn btn-primary">创建采购单</a></div>
                            {% endif %}
                        </div>
                    </div>
                </div>
            </div>

            <table class="table table-bordered">
                <thead>
                    <tr>
                        <td class="col-md-2">系统编号</td>
                        <td>供应商</td>
                        <td class="col-md-2">实际总金额(元)</td>
                        <td class="col-md-1">状态</td>
                        <td class="col-md-2">经办人</td>
                        <td class="col-md-2">创建时间</td>
                    </tr>
                </thead>
                <tbody>
                    {% for r in result.items %}
                        <tr>
                            <td><a href="{{url_for('bpPrh.view',action='view',id=r.id)}}">{{r.no}}</a></td>
                            <td>{{r.supplier}}</td>
                            <td>{{r.realAmount}}</td>
                            <td>{{r.status|ss(c='PO')}}</td>
                            <td>{{r.createBy}}</td>
                            <td>{{r.createTime|ft}}</td>
                        </tr>
                    {% endfor %}
                </tbody>                
            </table>
            {{mymacros.mypaginate(result)}}
        
        </div>
        
    </div>
</div>
{% endblock %}